/**
 * Copyright &copy; 2017 <a href="https://gitee.com/hackempire/emsite-parent">emsite</a> All rights reserved.
 */
package com.empire.emsite.modules.cms.entity;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.empire.emsite.common.config.GlobalConstants;
import com.empire.emsite.common.persistence.DataEntity;

/**
 * 类ArticleData.java的实现描述：文章Entity
 * 
 * @author arron 2017年10月30日 下午12:51:17
 */
public class ArticleData extends DataEntity<ArticleData> {

    private static final long serialVersionUID = 1L;
    private String            id;                   // 编号
    private String            content;              // 内容
    private String            copyfrom;             // 来源
    private String            relation;             // 相关文章
    private String            allowComment;         // 是否允许评论，使用枚举YesNoEnum

    private Article           article;

    public ArticleData() {
        super();
        this.allowComment = GlobalConstants.YesNoEnum.YES.getValue();
    }

    public ArticleData(String id) {
        this();
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @NotBlank
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Length(min = 0, max = 255)
    public String getCopyfrom() {
        return copyfrom;
    }

    public void setCopyfrom(String copyfrom) {
        this.copyfrom = copyfrom;
    }

    @Length(min = 0, max = 255)
    public String getRelation() {
        return relation;
    }

    public void setRelation(String relation) {
        this.relation = relation;
    }

    @Length(min = 1, max = 1)
    public String getAllowComment() {
        return allowComment;
    }

    public void setAllowComment(String allowComment) {
        this.allowComment = allowComment;
    }

    public Article getArticle() {
        return article;
    }

    public void setArticle(Article article) {
        this.article = article;
    }

}
